/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class CuestionarioDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression cod_cuestionario;
	public final StringExpression descripion;
	
	public CuestionarioDetachedCriteria() {
		super(Cuestionario.class, CuestionarioCriteria.class);
		cod_cuestionario = new IntegerExpression("cod_cuestionario", this.getDetachedCriteria());
		descripion = new StringExpression("descripion", this.getDetachedCriteria());
	}
	
	public CuestionarioDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, CuestionarioCriteria.class);
		cod_cuestionario = new IntegerExpression("cod_cuestionario", this.getDetachedCriteria());
		descripion = new StringExpression("descripion", this.getDetachedCriteria());
	}
	
	public MedicoDetachedCriteria createMedicoCriteria() {
		return new MedicoDetachedCriteria(createCriteria("ORM_Medico"));
	}
	
	public PreguntaDetachedCriteria createPreguntaCriteria() {
		return new PreguntaDetachedCriteria(createCriteria("ORM_Pregunta"));
	}
	
	public Cuestionario uniqueCuestionario(PersistentSession session) {
		return (Cuestionario) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Cuestionario[] listCuestionario(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Cuestionario[]) list.toArray(new Cuestionario[list.size()]);
	}
}

